<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/commons/taglibs.jsp" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" >
<head>
	<%@ include file="/commons/meta.jsp" %>
	<script language="javascript">
		$(function() {
			$("#publishDateFrom").datepicker({
				changeMonth: true,
				changeYear: true,
				dateFormat: 'yy-mm-dd',
				yearRange: 'c-70:c+70'
			});
			$("#publishDateTo").datepicker({
				changeMonth: true,
				changeYear: true,
				dateFormat: 'yy-mm-dd',
				yearRange: 'c-70:c+70'
			});
		});
	</script>
</head>
<body>
<%@ include file="/WEB-INF/view/header.jsp" %>
<div id="content">
	<%@ include file="/WEB-INF/view/leftbar.jsp" %>
	<div id="main">
		<h1>文献查询</h1>
		<form id="searchForm" action="queryLiterature" method="post">
		<table>
			<tr>
				<td>文章刊号</td>
				<td><input type="text" name="issueNo" value="${literatureQuery.issueNo }" maxlength="15" /></td>
			</tr>
			<tr>
				<td>文章名称</td>
				<td><input type="text" name="title" value="${literatureQuery.title }" maxlength="50" /></td>
			</tr>
			<tr>
				<td>学科类别</td>
				<td>
					<select name="categoryId">
						<option value="">请选择</option>
						<c:forEach var="category" items="${categories }">
							<option value="${category.id }" <c:if test="${literatureQuery.category.id == category.id }">selected="selected"</c:if>>${category.name }</option>
						</c:forEach>
					</select>
			</tr>
			<tr>
				<td>作者</td>
				<td><input type="text" name="author" value="${literatureQuery.author }" maxlength="10" /></td>
			</tr>
			<tr>
				<td>作者单位</td>
				<td><input type="text" name="authorFirm" value="${literatureQuery.authorFirm }" maxlength="50" /></td>
			</tr>
			<tr>
				<td>联系方式</td>
				<td><input type="text" name="authorContactInfo" value="${literatureQuery.authorContactInfo }" maxlength="100" /></td>
			</tr>
			<tr>
				<td>文章出处</td>
				<td><input type="text" name="source" value="${literatureQuery.source }" maxlength="50" /></td>
			</tr>
			<tr>
				<td>发表日期</td>
				<td>
					<input type="text" name="publishDateFrom" id="publishDateFrom" value="<fmt:formatDate value="${literatureQuery.publishDateFrom }" pattern="yyyy-MM-dd" />" />
					-
					<input type="text" name="publishDateTo" id="publishDateTo" value="<fmt:formatDate value="${literatureQuery.publishDateTo }" pattern="yyyy-MM-dd" />" />
				</td>
			</tr>
			<tr>
				<td></td>
				<td><input id="searchBtn" type="submit" value="查询" /></td>
			</tr>
		</table>
		</form>
		
		<table>
			<tr>
				<td>文章刊号</td>
				<td>文章名称</td>
				<td>学科类别</td>
				<td>作者</td>
				<td>作者单位</td>
				<td>联系方式</td>
				<td>文章出处</td>
				<td>发表日期</td>
				<td>操作</td>
			</tr>
			<c:forEach var="literature" items="${literatures }">
			<tr>
				<td>${literature.issueNo }</td>
				<td>${literature.title }</td>
				<td>${literature.category.name }</td>
				<td>${literature.author }</td>
				<td>${literature.authorFirm }</td>
				<td>${literature.authorContactInfo }</td>
				<td>${literature.source }</td>
				<td><fmt:formatDate value="${literature.publishDate }" pattern="yyyy-MM-dd" /></td>
				<td>
					<c:if test="${sessionUser.userType == 'ADMINISTRATOR'}">
						<a href="literatureForm?id=${literature.id }" target="_blank">修改</a>
					</c:if>
				</td>
			</tr>
			</c:forEach>
		</table>
	</div>
</div>
<%@ include file="/WEB-INF/view/footer.jsp" %>
</body>
</html>